#include "head.h"


int stdin_check(char *str, request_t * request){

        // 清除后面的空格
        char * arg = removeTrailingNewline(str);
        char * cmd = strtok(arg," ");
        //以空格符作为分隔        
        if(cmd == NULL){
            //printf("Error :Command missing\n");
            return -1;
        }
        //获取下一个参数
        char * args = strtok(NULL," ");
      
        int ret;
        if(strcmp(cmd,"cd")==0){
            //printf("flag = CD\n");
            return 0;
        }else if(strcmp(cmd,"ls")==0){
            //printf("flag = LS\n");
            return 0;
        }else if(strcmp(cmd,"puts")==0){

            return 0;
        }else if(strcmp(cmd,"gets")==0){

            return 0;
        }else if(strcmp(cmd,"rm")==0){

            return 0;
        }else if(strcmp(cmd,"pwd")==0){

            return 0;
        }else if(strcmp(cmd,"mkdir")==0){

            return 0;
        }else if(strcmp(cmd,"exit")==0){

            return 0; // 正常退出
        }else{
            //printf("aaa\n");
            return -1; // 未识别的命令，返回错误
        }
}



